package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.mapper.UserRecruitMapper;
import com.ly.heart.service.IUserRecruitService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.UserRecruitEntity;

import javax.annotation.Resource;

/**
 * 人员招聘申请记录Service业务层处理
 * @author wutao
 * @date 2024-05-31
 */
@Service
public class UserRecruitServiceImpl extends ServiceImpl<UserRecruitMapper, UserRecruitEntity> implements IUserRecruitService {

    @Resource
    private UserRecruitMapper userRecruitEntityMapper;

    /**
     * 查询人员招聘申请记录
     * @param id 人员招聘申请记录ID
     * @return 人员招聘申请记录
     */
    @Override
    public UserRecruitEntity selectUserRecruitEntityById (String id) {
        return userRecruitEntityMapper.selectUserRecruitEntityById ( id );
    }

    /**
     * 查询人员招聘申请记录列表
     * @param userRecruitEntity 人员招聘申请记录
     * @return 人员招聘申请记录
     */
    @Override
    public List<UserRecruitEntity> selectUserRecruitEntityList (UserRecruitEntity userRecruitEntity) {
        return userRecruitEntityMapper.selectUserRecruitEntityList ( userRecruitEntity );
    }

    /**
     * 新增人员招聘申请记录
     * @param userRecruitEntity 人员招聘申请记录
     * @return 结果
     */
    @Override
    public int insertUserRecruitEntity (UserRecruitEntity userRecruitEntity) {
        userRecruitEntity.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        userRecruitEntity.setCreateTime ( DateUtils.getNowDate () );
        return userRecruitEntityMapper.insertUserRecruitEntity ( userRecruitEntity );
    }

    /**
     * 修改人员招聘申请记录
     * @param userRecruitEntity 人员招聘申请记录
     * @return 结果
     */
    @Override
    public int updateUserRecruitEntity (UserRecruitEntity userRecruitEntity) {
        userRecruitEntity.setUpdateTime ( DateUtils.getNowDate () );
        return userRecruitEntityMapper.updateUserRecruitEntity ( userRecruitEntity );
    }

    /**
     * 批量删除人员招聘申请记录
     * @param ids 需要删除的人员招聘申请记录ID
     * @return 结果
     */
    @Override
    public int deleteUserRecruitEntityByIds (String[] ids) {
        return userRecruitEntityMapper.deleteUserRecruitEntityByIds ( ids );
    }

    /**
     * 删除人员招聘申请记录信息
     * @param id 人员招聘申请记录ID
     * @return 结果
     */
    @Override
    public int deleteUserRecruitEntityById (String id) {
        return userRecruitEntityMapper.deleteUserRecruitEntityById ( id );
    }
}
